package SPRING_AUTHC_ABSENT;

public class Fixed {
    @Configuration
    @EnableWebSecurity
    public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
        @Override
        protected void configure(HttpSecurity http) throws Exception {

            http.authorizeRequests()
                    .antMatchers(HttpMethod.POST,"/version ").hasAnyRole("ADMIN","USER")
                    .antMatchers(HttpMethod.POST,"/api-docs ").anonymous()
                    .antMatchers(HttpMethod.PUT,"/profile").authenticated()
                    .antMatchers(HttpMethod.PUT ,"/admin").hasRole("admin")
                    .and().httpBasic();
        }
}
